

function file_upload(val){
		 var returnValue=window.showModalDialog('intFile.action',null,'dialogHide:yes;help:no;status:no;scroll:yes;unadorned:no;unadorned:yes;resizable:yes;dialogHeight:430px;dialogWidth:780px');
		 if(returnValue!=null && returnValue!=""){
			var param={"fileArray":returnValue};
			$.post("getFileList.action",param,function(data) {
				var list=data.fileList;
				for(var i=0;i<list.length;i++){
					$("#"+val).prepend("<tr><td><input type=\"checkbox\" name=\"checkbox2\" id=\""+list[i].id+"\" value=\""+list[i].id+"\" />&nbsp;<a href=\"downLoadFile.action?fileId="+list[i].id+"\">"+list[i].name+"</a>&nbsp;</tr>");
		        }
			},"json");
		 }
     }

     function fileDel(tableId){
		var input=$("#"+tableId).find("input");
		var toDeleteFileStr;
		$.each(input, function(i, n) {
			if($(this).attr("checked")!=false){
				 $($(this).parent()).remove();
				if(!toDeleteFileStr)
				    toDeleteFileStr=$(this).attr("id")
				else
				    toDeleteFileStr=toDeleteFileStr+","+$(this).attr("id");    
			}
		});
		var input1=$("#"+tableId).prev().find("input");
		$.each(input1, function(i, n) {
			if(i==0){
				$(this).attr("checked",false);
			}
		});
		if(toDeleteFileStr){
		   	var state=$("#status").val();
			if(state!='send'){
		    var param={"fileArray":toDeleteFileStr};
			$.post("deleteFile.action",param,function(data) {
		    }); 
		    }
		}		
	 }	